package com.edu.base.common;

import java.util.Random;

 
public class ShareCodeUtil { 
	public static String generateCode() {
		String charList = "ABCDEFGHIJKLMNPQRSTUVWXY";
		String numList = "0123456789";
		String rev = "";
		int maxNumCount = 4;
		int length = 6;
		Random f = new Random();
		for (int i = 0; i < length; i++) {
			if (f.nextBoolean() && maxNumCount > 0) {
				maxNumCount--;
				rev += numList.charAt(f.nextInt(numList.length()));
			} else {
				rev += charList.charAt(f.nextInt(charList.length()));
			}
		}
		return rev;
	}

}
